package com.mysqldemo.controller;

import com.mysqldemo.enums.ResponseCodeEnum;

import com.mysqldemo.entity.vo.ResponseVO;

public class ABaseController {
    protected static final String SUCCESS = "success";
    protected static final String ERROR = "error";

    protected <T> ResponseVO getSuccessResponseVO(T t) {
        ResponseVO<T> responseVO = new ResponseVO<>();
        responseVO.setStatus(SUCCESS);
        responseVO.setCode(ResponseCodeEnum.SUCCESS.getCode());
        responseVO.setInfo(ResponseCodeEnum.SUCCESS.getMessage());
        responseVO.setData(t);
        return responseVO;
    }

}
